Fix --reset flag regression: skip spurious TOML selection prompt before link flow#7238
Fix --reset flag regression: skip spurious TOML selection prompt before link flow#7238timothytenzin20 wants to merge 2 commits intomainfrom
Conversation
…re link flow When running `shopify app dev --reset`, `getAppConfigurationContext()` was called unconditionally before checking `forceRelink`. If the cached config file didn't exist on disk, this triggered `selectConfigFile()`, prompting the user to pick a TOML file that would be immediately discarded by `link()`. Regression introduced by #6612 ("Remove legacy app schema", commit 1f8dcce) which merged the forceRelink and !isLinked branches back together, undoing the prior fix from #5676. Fix: separate the two paths so forceRelink skips `getAppConfigurationContext()` entirely and calls `link()` directly. Fixes shop/issues-develop#22531
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
/snapit |
|
🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm. Test the snapshot by installing your package globally: npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260410122533Caution After installing, validate the version by running |
gonzaloriestra
left a comment
There was a problem hiding this comment.
Thanks for the PR! The fix makes sense, but I think something is not working. I'm still getting the config prompt when running pnpm shopify app info --reset after deleting the current TOML and having multiple ones.
I think what's missing is to avoid it from link. In 04-08-fix_reset_spurious_toml_selection_prompt_2 I added the missing pieces. Still have to review and test more, but it seems to work. Feel free to add here the changes from there if you want.
|
/snapit |
|
🫰✨ Thanks @timothytenzin20! Your snapshot has been published to npm. Test the snapshot by installing your package globally: npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260410185310Caution After installing, validate the version by running |
|
@gonzaloriestra thanks for the feedback, i made the changes and added tophatting results/steps |

Bug
shopify app dev --resetspuriously prompts TOML file selection before the reset flow (org → app → config name). The selected TOML is immediately discarded.Issue: shop/issues-develop#22531
Root Cause
Regression introduced by #6612 ("Remove legacy app schema", merged Mar 2026). Commit
1f8dcceaec("Simplify code") merged theforceRelinkand!isLinkedbranches back together, undoing a prior fix from #5676 (Apr 2025) which fixed #5653 by separating theforceRelinkpath so it skips config state loading.getAppConfigurationContext()is called unconditionally before checkingforceRelink. When the cached config file doesn't exist on disk, it callsselectConfigFile(), prompting the user to pick a TOML — even thoughforceRelinkwill discard the result.Fix
Two changes:
app-context.ts— Separate theforceRelinkand!isLinkedpaths soforceRelinkskipsgetAppConfigurationContext()entirely and callslink()directly.link.ts/loader.ts/active-config.ts— Thread askipPromptsoption throughlink()→loadApp()/loadOpaqueApp()→getAppConfigurationContext()→selectActiveConfig()so that the stale-cache prompt is also skipped when called from inside the link flow.Test
Added test verifying
getAppConfigurationContextis only called afterlink()whenforceRelinkis true (usinginvocationCallOrdertracking).All 12 tests pass ✅
🎩
Expected Results:
Using latest:
Using snapshot (0.0.0-snapshot-20260410185310):
Setup
Navigate to any Shopify app directory that has multiple
shopify.app.*.tomlfiles, then delete the currently cached/active TOML so the stale-cache path is triggered.Warning
Make sure to double check the version change is working by using
which shopify && shopify versionIf the version is not changing use these commands:
pnpm remove -g @shopify/clipnpm add -g @shopify/cli@[version]which shopify && shopify version1. Reproduce the bug (
@latest)Expected (broken): You get prompted to select a TOML file before the org → app → config name flow. The selection is immediately discarded.
2. Verify the fix (@0.0.0-snapshot-20260410185310)
Expected (fixed): Goes straight into the org → app → config name flow with no spurious TOML selection prompt.